<?php
//自定义后台操作
function comment_set_show(&$obj){//评论通过
   //要操作的项目id组
   $item_ids=$_GET["item_ids"];
   $item_ids_arr=explode(",",$item_ids);
   foreach($item_ids_arr as $k=>$v){
	   $old_check=$obj->model->where("id=$v")->getField("is_check");
	   $now_check=($old_check=="是")?"否":"是";
	   $obj->model->where("id=$v")->setField("is_check",$now_check);   
   }
   redirect(U(ucfirst($obj->table)."/index",$obj->redirect_param));	
}
function comment_set_not_show(&$obj){//取消审核
   //要操作的项目id组
   $item_ids=$_GET["item_ids"];
   $item_ids_arr=explode(",",$item_ids);
   foreach($item_ids_arr as $k=>$v){
	   $obj->model->where("id=$v")->setField("is_show","否");   
   }
   redirect(U(ucfirst($obj->table)."/index",$obj->redirect_param));	
}
function article_is_check(&$obj){//审核文章
   //要操作的项目id组
   $item_ids=$_GET["item_ids"];
   $item_ids_arr=explode(",",$item_ids);
   foreach($item_ids_arr as $k=>$v){
	   $obj->model->where("id=$v")->setField("is_check","是");   
   }
   redirect(U(ucfirst($obj->table)."/index",$obj->redirect_param));	
}

function order_set_is_detail(&$obj){//处理订单
  //要操作的项目id组
   $item_ids=$_GET["item_ids"];
   $item_ids_arr=explode(",",$item_ids);
   foreach($item_ids_arr as $k=>$v){
	   $old_status=$obj->model->where("id=$v")->getField("order_status");
	   $new_status=($old_status=="已处理")?"未处理":"已处理";
	   $obj->model->where("id=$v")->setField("order_status",$new_status);   
   }
   redirect(U(ucfirst($obj->table)."/index",$obj->redirect_param));	
}
?>